﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZeroBug.EasyFlow.Core
{
    public class SingletonProvider<T> where T : new()
    {
        public SingletonProvider()
        {
        }

        public static T Instance
        {
            get
            {
                return SingletonCreator.Instance;
            }
            set
            {
                SingletonCreator.Instance = value;
            }
        }
        internal class SingletonCreator
        {
            internal static T Instance
            {
                get;
                set;
            }
                = new T();
        }
    }
}
